# 1.单线程
# 【2.多线程】
# 3.资源共享与竞争
import time
from threading import Thread


def funa():
    for i in range(10):
        time.sleep(1)
        print(f'a{i}执行')

def funb():
    for i in range(20):
        time.sleep(1)
        print(f'b{i}执行')

if __name__ == '__main__' :
    ta = Thread(target=funa)
    ta.start()

    tb = Thread(target=funb)
    tb.start()
    # ta.join()
    ta.join() # ta线程完成 才能执行'结束'
    print('结束')











